package com.asiainfo.web.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 主控制器
 * @author luhf
 * @date Jan 7, 2013 12:44:51 PM
 */
@Controller
public class MainController{
	
	private static final Logger log=LoggerFactory.getLogger(MainController.class);
	
	@RequestMapping(value="/")
	public String index(){
		log.debug("MainController::index::跳转到首页面");
		return "index";
	}
	
	@RequestMapping(value="/main")
	public String main(){
		log.debug("MainController::main::跳转到主页面");
		return "main";
	}
	
	@RequestMapping(value="/visit/{controller}/{method}")
	public String visit(@PathVariable("controller")String controller,@PathVariable("method")String method){
		log.debug("MainController::visit::重定向到到URL{}controller:"+controller+"{}method:"+method);
		return "redirect:/"+controller+"/"+method;
	}
	
}
